home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / CIT.v4 / Demo / ClickTabTest.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-13  |  2.0 KB  |  84 lines

  1. #include <CITGroup.h>
  2. #include <CITButton.h>
  3. #include <CITClickTab.h>
  4. #include <CITString.h>
  5.  
  6. CITApp Application;
  7.  
  8. CITWorkbench myScreen;
  9. CITWindow    myWindow;
  10. CITVGroup    page[2];
  11. CITVGroup    group;
  12. CITButton    quitButton;
  13. CITClickTab  clickTab;
  14. CITString    string1,string2,string3;
  15.  
  16. void CloseEvent();
  17. void QuitEvent(ULONG ID);
  18.  
  19. int main(void)
  20. {
  21.   BOOL Error=FALSE;
  22.  
  23.   myScreen.InsObject(myWindow,Error);
  24.     myWindow.Position(WPOS_CENTERSCREEN);
  25.     myWindow.CloseGadget();
  26.     myWindow.DragBar();
  27.     myWindow.SizeGadget();
  28.     myWindow.DepthGadget();
  29.     myWindow.IconifyGadget();
  30.     myWindow.Caption("CITGadgets");
  31.     myWindow.CloseEventHandler(CloseEvent);
  32.     myWindow.InsObject(group,Error);
  33.       group.BevelStyle();
  34.       group.BevelLabel("A text");
  35.       group.InsObject(clickTab,Error);
  36.         clickTab.NewTab(page[0],"Tab 1");
  37.           page[0].InsObject(string1,Error);
  38.             string1.LabelText("Type a text _1:");
  39.             string1.LabelJustification(LJ_RIGHT);
  40.             string1.TextVal("Start");
  41.             string1.MinVisible(10);
  42.             string1.MaxChars(20);
  43.         clickTab.NewTab(page[1],"Tab 2");
  44.           page[1].InsObject(string2,Error);
  45.             string2.LabelText("Type text number _2:");
  46.             string2.LabelJustification(LJ_RIGHT);
  47.             string2.TextVal("");
  48.             string2.MinVisible(10);
  49.             string2.MaxChars(20);
  50.           page[1].InsObject(string3,Error);
  51.             string3.LabelText("Write text _3:");
  52.             string3.LabelJustification(LJ_RIGHT);
  53.             string3.TextVal("");
  54.             string3.MinVisible(10);
  55.             string3.MaxChars(20);
  56.       group.InsObject(quitButton,Error);
  57.         quitButton.Text("Quit");
  58.         quitButton.EventHandler(QuitEvent);
  59.  
  60.   Application.InsObject(myScreen,Error);
  61.  
  62.   // Ok?
  63.   if( Error )
  64.     return 10;
  65.  
  66.   Application.Run();
  67.  
  68.   Application.RemObject(myScreen);
  69.  
  70.   return 0;
  71. }
  72.  
  73. void QuitEvent(ULONG ID)
  74. {
  75.   Application.Stop();
  76. }
  77.  
  78. int repeatCount = 0;
  79.  
  80. void CloseEvent()
  81. {
  82.   Application.Stop();
  83. }
  84.